<%-- 
    Document   : index
    Created on : Nov 3, 2013, 10:25:44 AM
    Author     : Min Tun
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Trang chủ</title>
        <link rel="stylesheet" href="template/style.css" />
        <style>
            body {
                margin-top: 20px;
            }
        </style>
    </head>
    <body>
        <div class="container">
            <%@include file="./template/_header.jsp" %>
            <div class="row">
                <div class="col9 body-content" style="margin-top: 50px;">
                    <div class="row">
                        <c:if test="${not empty requestScope.POSTS}">
                            <c:set var="posts" value="${requestScope.POSTS}"/>
                            <c:forEach var="item" items="${posts}">
                                <div class="col6">
                                    <div class="post">
                                        <span class="title">${item.post.title}</span>
                                    </div>
                                </div>
                            </c:forEach>
                        </c:if>
                    </div>
                </div>
                <%@include file="./template/_sidebar.jsp" %>
            </div>
            <div class="row">
                <div class="col12 body-content" style="margin-top: 50px;">
                    <a href="javascript:search();">Click here</a>
                </div>
            </div>
        </div>
        <script type="text/javascript">          
            function search(){
                var req = new XMLHttpRequest();
                var url = "test.txt";
                req.open("GET", url, true);
                req.send(null);
                var xmlDOM = req.responseText;
                alert(xmlDOM);
                             
            }
        </script>
</html>
